export class SavePlatformData
{
    public token:string;
    public android_id;
    public build;
    public category;
    public client_ts;
    public connection_type;
    public device;
    public event_id;
    public manufacturer;
    public os_version;
    public platform;
    public sdk_version;
    public session_id;
    public session_num;
    public user_id;
    public d0;
    public d1;
    public d2;
    public d3;
    public d4;
    public d5;
}


export class WeChatShareData
{
    public Title:string;
    public ImageId:string;
    public ImageUrl:string;
}

export class AdConfigData
{
    public AppId:string="";
    public AppName:string="";
    public AppIcon:string="";
}




export  class Dictionary 
{
    items: object;
    constructor() 
    {
      this.items = {};
    }

    has(key: any): boolean 
    {
      return this.items.hasOwnProperty(key);
    }

    set(key: any, val: any) 
    {
      this.items[key] = val;
    }

    delete(key: any): boolean {
      if (this.has(key)) {
        delete this.items[key];
      }
      return false;
    }

    get(key: any): any 
    {
      return this.has(key) ? this.items[key] : undefined;
    }

    values(): any[] 
    {
      let values: any[] = [];
      for (let k in this.items) {
        if (this.has(k)) {
          values.push(this.items[k]);
        }
      }
      return values;
    }

    GetValueByIndex(index:number)
    {
        if (index>=this.keyCount()) 
        {
            return null;
        }
        let keindex=0;
        for (let k in this.items) 
        {
            if (this.has(k)) 
            {
                if (keindex==index) 
                {
                    return this.items[k];
                }
                keindex++;
            }
        }
        return null;
    }

    GetKeyByIndex(index:number)
    {
        if (index>=this.keyCount()) 
        {
            return null;
        }
        let keindex=0;
        for (let k in this.items) 
        {
            if (this.has(k)) 
            {
                if (keindex==index) 
                {
                    return k;
                }
                keindex++;
            }
        }
        return null;
    }


    keyCount(){
        let count=0;
        for (let k in this.items) {
          if (this.has(k)) 
          {
              count++;
          }
        }
        return count;
      }

  }



